× Lesson 1 Lesson 2 Lesson 3 Lesson 4 Lesson 5 Lesson 6 Lesson 7 Lesson 8 Lesson 9 Lesson 10 Lesson 11 Lesson 12 Lesson 13 Lesson 14 Lesson 15 Lesson 16 Lesson 17 Lesson 18 Lesson 19 Lesson 20 Lesson 21 Lesson 22 Lesson 23 Lesson 24 Lesson 25 Mini Lesson 1 Mini Lesson 2 Mini Lesson 3 Mini Lesson 4 Mini Lesson 5

Lessons

Lesson 10 - Conditions

Conditions are just like inequalities in math, <, <=, ==, >, >=, !=. If the condition makes since, then it is true, and value of inequality would be True, however if the inequality is false, than the value of the inequality would be False.

For example, print(43 < 21) would output False, as the 43 is not less than 21. Some of the unique conditions are !=, where if the two values are not equal, then the value is True. The condition 'or' is True if one or more of the conditions are True, for example print(True or 43 < 21) would output True, even though 43 is not less than 21. For and, both conditions have to be True for it to be True, and not, which reverses the value of a condition, for example print(not True) would output False.

A challenge for you is to guess the output of the following code: print(not True and False or 43 < 21 and True or 21 >= 21)

Once you have completed the challenge move on to the next lesson.